<?php
/* @var $this GaleriController */
/* @var $dataProvider CActiveDataProvider */
cs()->registerCssFile(bu().'/css/jquery.mCustomScrollbar.css');
cs()->registerScriptFile(bu() . '/plugins/jquery-ui-1.9.1.custom.min.js', CClientScript::POS_BEGIN);
cs()->registerScriptFile(bu() . '/plugins/jquery.mousewheel.min.js', CClientScript::POS_BEGIN);
cs()->registerScriptFile(bu() . '/plugins/jquery.mCustomScrollbar.js', CClientScript::POS_BEGIN);
$is_indo = lang() == "id";


?>
<script>
    (function ($) {
        $(window).load(function () {
            /* custom scrollbar fn call */
            $(".content_6").mCustomScrollbar({
                horizontalScroll:true,
                advanced:{
                    autoExpandHorizontalScroll:true
                }
            });
        });
    })(jQuery);
    function klikfoto(a) {
        var bt = '<img src="<?=bu();?>/img/galeri/full/' + a + '.jpg" width="519px" height="390px">';
        bt += '<div style="position: absolute;bottom: 0px;left:100px;background:url(<?=bu();?>/img/bckfoto_utama.png)'
        bt += 'repeat-y top center;min-height:50px;width:520px;text-align:left">';
        var requestData = {'YII_CSRF_TOKEN': '<?=app()->request->csrfToken?>'};
        $.post('<?=url("galeri/view")?>/' + a, requestData, function(data) {
            bt += data + '</div>';
            jQuery("#foto").html(bt);
        });

    }
</script>

<div align="center" id="foto" style="position: relative;">
    <img src="<?=bu();?>/img/galeri/full/<?=$model[0]->id?>.jpg" width="519px" height="390px"/>

    <div style="position: absolute;bottom: 0px;left:100px;background:url(<?=bu();?>/img/bckfoto_utama.png) repeat-y top center;min-height:50px;width:520px;text-align:left">
        <?=$is_indo ? $model[0]->nama : $model[0]->name_; ?><br/><?=$is_indo ? $model[0]->isi : $model[0]->content; ?>
    </div>
</div>

<div class="content_6 content">
    <div class="images_container">
        <?
        foreach ($model as $img) {
            echo '<img src="' . bu() . '/img/galeri/thumb/' . $img->id . '.jpg" onclick="klikfoto(' . $img->id .')" style="cursor:pointer"/>';
        }
        ?>
    </div>
</div>

    